<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="__CSS__/ex/common.css">
    <link rel="stylesheet" href="__CSS__/ex/login.css">
    <title>公告</title>
    <script src="__JS__/ios-web-app.js"></script>
</head>

<body style="padding-top: 38px">
    <header class="normal_header">
        <div class="header_pic">
<!--            <a href="{:U('user/notice')}"><img src="__IMG__/ex/back_black.png" alt=""></a>-->
            <a href="javascript:history.go(-1)"><img src="__IMG__/ex/back_black.png" alt=""></a>
        </div>
        <p>{$content.title}</p>
        <div class="header_pic"></div>
    </header>
    <div class="notice_content">
        <!--<h2>{$content.title}</h2>-->
        <!--<p>{$content.create_time|date='Y-m-d H:i:s',###}</p>-->
        {$content.content}
        <!--<div>-->
            <!--<if condition="$content.is_lottery gt 0">-->
                <!--中奖者需要支付平台奖品价值5%的服务费.-->
                <!--<if condition="$lottery_winner.is_sure eq 0">-->
                    <!--同意请点击去领奖按钮.-->
                    <!--<div>-->
                        <!--<div class="go_lottery" lottery_id="{$content.is_lottery}" usdt="{$user.z8}" award_price="{$lottery_winner.award_price}">去领奖</div>-->
                    <!--</div>-->
                <!--</if>-->



            <!--</if>-->
        <!--</div>-->
    </div>

    <style>
        .notice_content {
            padding: .3rem;
            box-sizing: border-box;
        }
        .notice_content p{
            line-height: 2;
            /*text-indent: 2em;*/
        }
        .notice_content video{
            width: 100%;
        }
        .go_lottery{
            width: 1.8rem;
            line-height: .65rem;
            border-radius: .325rem;
            text-align: center;
            color: #fff;
            margin: .35rem auto;
            background-color: #0058e8
        }
    </style>
    <script src="__COMMON__/js/jquery.min.js"></script>
    <script src="__LIB__/layer/layer.js"></script>

    <script>
        $(".go_lottery").click(function () {
            $usdt=$(this).attr('usdt');
            $award_price=$(this).attr('award_price');
            $fw=$award_price*5/100;
            $lottery_id=$(this).attr('lottery_id');
            $status={$status};
            // alert($status);return false;
            if(parseFloat($usdt)<parseFloat($fw)){
                alert('您的余额不足以支付奖品的服务费');return false;
            }
            if({$status}==0){
                alert('地址未填写');return false;
            }

            layer.open({
                type: 1,
                title: "领奖",
                shadeClose: true,
                shade: 0.4,
                // skin: 'choujiang',
                area: ['90%', '40%'],
                content: '<div>\n' +
                    '          <p>服务费:'+$fw+'</p>\n' +
                    '          <p>您的USDT余额：'+$usdt+'</p>\n' +
                    ' <label for="">支付密码：</label>'+
                    '          <input type="password" placeholder="输入支付密码" id="password2">\n' +
                    '      </div>',
                btn: ['领奖','关闭'],
                yes: function(index){
                    //当点击‘确定’按钮的时候，获取弹出层返回的值
                    $.ajax({
                        type:"post",
                        dataType:"json",
                        url:"{:U('sure_go')}",
                        data:{
                            fw:$fw,
                            lottery_id:$lottery_id,  //抽奖期号
                            password2:$("#password2").val(),//密码
                        },
                        success:function (data) {
                            if(data.code>0){
                                layer.msg(data.message,{time:2000},function () {
                                    window.location.reload();
                                });
                            }else {
                                layer.msg(data.message,{time:2000});
                            }
                        }
                    })
                    //打印返回的值，看是否有我们想返回的值。
                    //最后关闭弹出层
                    layer.close(index);
                },
                cancel: function(){
                    //右上角关闭回调
                }
            });
        })
    </script>
</body>

</html>